boot_dir := boot/
loader_dir := loader/
kernel_dir := kernel/

#phony target
.PHONY:all $(boot_dir) $(loader_dir) $(kernel_dir) clean boot_clean kernel_clean loader_clean

all:$(boot_dir) $(loader_dir) $(kernel_dir)

$(boot_dir): 
	$(MAKE) --directory=$@

$(loader_dir): 
	$(MAKE) --directory=$@

$(kernel_dir): 
	$(MAKE) --directory=$@


#clean objects files and other files 
clean:boot_clean kernel_clean loader_clean
	
boot_clean:
	$(MAKE) --directory=$(boot_dir) boot_clean

kernel_clean:
	$(MAKE) --directory=$(kernel_dir) kernel_clean

loader_clean:
	$(MAKE) --directory=$(loader_dir) loader_clean
